package com.bdqn.t320.ch13.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bdqn.t320.ch13.entity.User;
import com.bdqn.t320.ch13.entity.vo.UserVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper extends BaseMapper<User> {

    public int insert(User user);

    @Select("select * from sys_user")
    public List<User> getUserAll();

    @Select("select rf_right_code from sys_role_right where rf_role_id = (select usr_role_id from sys_user where usr_id = #{usrId})")
    public List<String> getRightCodeByUserId(Long usrId);

    public Page<UserVo> getCustomPageUserListDao(@Param("page") Page<UserVo> page, @Param("user") User user);
}
